package com.mzydz.shutdown;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * Created by Saber on 2018/1/2.
 */

public class BootBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Intent service = new Intent(context, MainActivity.class);
        service.putExtra("action", "createAlarm");
        service.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startService(service);
        Log.v("BootBroadcastReceiver", "开机自动服务自动启动.....");
    }
}